<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<#setting locale="vi">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="Shortcut Icon" href="../images/ncms.ico" type="image/x-icon"/>
<title>Order Printing</title>
<style type="text/css">
*{ margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; font-size: 15px; }
/*#wrapper { width: 18.5cm; height: 13.55cm; overflow: hidden; background: url(phieuthu.jpg) no-repeat -.3cm bottom; padding: 0 0 0 0.8cm; }*/
#wrapper { width: 18.5cm; height: 14cm; overflow: hidden; background: url(phieuthu.jpg) no-repeat; padding: 0 0 0 0.5cm }
#header { height: 2.5cm; /*height: 2.8cm;*/ }
#receiptInfo { height: 10.2cm; }
#footer { height: 0.5cm; }

.toRight { float: right; }
.italic { font-style: italic !important; }

/* info 01 */
.printDate { text-align: center; margin: 5px 0 7px; }
.printDate strong { font-style: italic; }
.info01 strong { }
.info { width: 18cm; margin-left: .5cm; font-size: 14px; }
.info td { padding: 2px 2px; font-size: 14px; }
.info td strong { font-size: 14px; }
.info td span { margin-left: 10px; font-size: 14px; }
.signatures { width: 100%; margin-top: 2px; }
.signatures td { width: 33.3%; text-align: center; }
cpc { text-transform: capitalize; }

table.list { border: 1px solid #000; border-collapse: collapse; margin: auto; }
table.list td, table.list th { border: 1px solid #000; padding: 2px; font-size: 13px; }
table.list th { background: #FEF; }
.right { text-align: right !important; }
.center { text-align: center !important; }
</style>
</head>

<body>
<div id="wrapper">
  <div id="header">
  	<div style="padding: 8px 0 0 580px; font-weight: bold; font-size: 13px;">${(order.number)!}</div>
  </div>
  
  <div id="receiptInfo">
  	<div class="printDate">
    	Ngày ${(DateUtil.getDayOfMonth(order.date))!} tháng ${(DateUtil.getMonth(order.date) + 1)!} năm ${(DateUtil.getYear(order.date))?string("####")}
    </div>
    
    <div class="info02">
    	<table class="info" cellspacing="9">
      	<tr>
        	<td width="165"><strong>Họ tên người nộp tiền</strong></td>
          <td><span>: ${(order.studentName)!}</span></td>
        </tr>
        <tr>
          <td><strong>Mức phí phải thu</strong></td>
          <td><span>: <b>${(order.totalPrice.amount)!} ${i18n.getMessage('currency.vnd')}</b></span></td>
        </tr>
        <tr>
          <td colspan="2">

          	<table class="list">
            	<tr>
              	<th>STT</th>
                <th width="250">Loại Sách</th>
                <th>Mã Sách</th>
                <th width="50">ĐVT</th>
                <th>Số Lượng</th>
                <th width="60">Đơn Giá (VNĐ)</th>
                <th>Thành Tiền</th>
              </tr>
              <#assign index = 1>
              <#list order.details as detail>
              	<tr>
	              	<td class="center">${index}</td>
	                <td>${(detail.item.displayName)!}</td>
	                <td>${(detail.item.itemId)!}</td>
	                <td class="center">${(detail.item.itemType.unit)!}</td>
	                <td class="center">${(detail.quantity)!}</td>
	                <td class="right">${(detail.item.price.amount)!}</td>
	                <td class="right">${(detail.totalPrice)!}</td>
              	</tr>
              	<#assign index = index + 1>
              </#list>
              <#list index..4 as i>
              	<tr>
	              	<td class="center">${i}</td>
	                <td></td>
	                <td></td>
	                <td class="center"></td>
	                <td class="center"></td>
	                <td class="right"></td>
	                <td class="right"></td>
              	</tr>
              </#list>
            </table>
          </td>
        </tr>
        <tr>
          <td class="italic" colspan="2">
          	(Số tiền viết bằng chữ: <cpc>${(View.getFirstString(NumberUtil.name(order.totalPrice.amount)))!}</cpc> ${(View.getFromSecondString(NumberUtil.name(order.totalPrice.amount)))!})
          </td>
        </tr>
      </table>
      
      <!-- signatures -->
      <table class="signatures">
      	<tr>
        	<td>Người nộp tiền</td>
          <td>Người lập biểu</td>
          <td>Thủ quỹ</td>
        </tr>
      </table>
      <div style="height: 1.4cm;"></div>
      <table class="signatures">
      	<tr>
        	<td>${(order.studentName)!}</td>
          	<td>${(order.cashier.fullName)!}</td>
          	<td>Lê Thị Thanh Nhung</td>
        </tr>
      </table>
    </div>
  </div>
  
  <div id="footer"></div>
</div>
</body>
</html>